package com.qjcc.domain;

import com.fasterxml.jackson.annotation.JsonIgnore;

import java.util.List;
import java.util.Map;

public class Series {

    private String name;
    //column,spline
    private String type;
    private int yAxis = 0;
    private List<Double> data;
    private Map<String, String> tooltip;
    private double pointPadding = 0.2;
    private double borderWidth = 0;
    private String color;
    private int lineWidth = 4;

    @JsonIgnore
    private static String[] colors = {"#fc4041", "#f38b08", "#149d9c", "#2577df", "#46b8da"};

    public static String getColor(int index){
        if(index >= colors.length){
            return null;
        }
        return colors[index];
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public int getyAxis() {
        return yAxis;
    }

    public void setyAxis(int yAxis) {
        this.yAxis = yAxis;
    }

    public List getData() {
        return data;
    }

    public void setData(List data) {
        this.data = data;
    }

    public Map<String, String> getTooltip() {
        return tooltip;
    }

    public void setTooltip(Map<String, String> tooltip) {
        this.tooltip = tooltip;
    }

    public double getPointPadding() {
        return pointPadding;
    }

    public void setPointPadding(double pointPadding) {
        this.pointPadding = pointPadding;
    }

    public double getBorderWidth() {
        return borderWidth;
    }

    public void setBorderWidth(double borderWidth) {
        this.borderWidth = borderWidth;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    public int getLineWidth() {
        return lineWidth;
    }

    public void setLineWidth(int lineWidth) {
        this.lineWidth = lineWidth;
    }
}
